package com.zzvcom.persist.model.admin;

import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.Formula;

import com.zzvcom.persist.model.IdEntity;

@Entity
@Table(name = "product")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Product extends IdEntity
{
    private String no;

    private String commodity;

    private String size;

    private String quality;

    private double wholesaleprice;

    private double wholesaleprice1;

    private double retailprice;

    private double retailprice1;

    private String paymentterm;

    private String origin;

    private String image;

    private String addtime;

    private String categoryid;

    private String kpsi;

    private String foundation;

    private String pile;

    @Column(insertable = false, updatable = false)
    private long click;

    /*
     * 0 hot ;1 unhot
     */
    private String hot;

    @Formula("(select c.name from category c where c.id=categoryid)")
    private String categoryName;

    /** translient object for business* */
    @Transient
    private Map<String, String> meta = new HashMap<String, String>();

    @Transient
    private String des;

    public String getCommodity()
    {
        return commodity;
    }

    public String getNo()
    {
        return no;
    }

    public void setNo(String no)
    {
        this.no = no;
    }

    public void setCommodity(String commodity)
    {
        this.commodity = commodity;
    }

    public String getSize()
    {
        return size;
    }

    public void setSize(String size)
    {
        this.size = size;
    }

    public String getQuality()
    {
        return quality;
    }

    public void setQuality(String quality)
    {
        this.quality = quality;
    }

    public double getWholesaleprice()
    {
        return wholesaleprice;
    }

    public void setWholesaleprice(double wholesaleprice)
    {
        this.wholesaleprice = wholesaleprice;
    }

    public double getRetailprice()
    {
        return retailprice;
    }

    public void setRetailprice(double retailprice)
    {
        this.retailprice = retailprice;
    }

    public String getPaymentterm()
    {
        return paymentterm;
    }

    public void setPaymentterm(String paymentterm)
    {
        this.paymentterm = paymentterm;
    }

    public String getOrigin()
    {
        return origin;
    }

    public void setOrigin(String origin)
    {
        this.origin = origin;
    }

    public String getImage()
    {
        return image;
    }

    public void setImage(String image)
    {
        this.image = image;
    }

    public String getAddtime()
    {
        return addtime;
    }

    public void setAddtime(String addtime)
    {
        this.addtime = addtime;
    }

    public String getCategoryid()
    {
        return categoryid;
    }

    public void setCategoryid(String categoryid)
    {
        this.categoryid = categoryid;
    }

    public String getCategoryName()
    {
        return categoryName;
    }

    public void setCategoryName(String categoryName)
    {
        this.categoryName = categoryName;
    }

    public String getKpsi()
    {
        return kpsi;
    }

    public void setKpsi(String kpsi)
    {
        this.kpsi = kpsi;
    }

    public String getFoundation()
    {
        return foundation;
    }

    public void setFoundation(String foundation)
    {
        this.foundation = foundation;
    }

    public String getPile()
    {
        return pile;
    }

    public void setPile(String pile)
    {
        this.pile = pile;
    }

    public String getHot()
    {
        return hot;
    }

    public void setHot(String hot)
    {
        this.hot = hot;
    }

    public double getWholesaleprice1()
    {
        return wholesaleprice1;
    }

    public void setWholesaleprice1(double wholesaleprice1)
    {
        this.wholesaleprice1 = wholesaleprice1;
    }

    public double getRetailprice1()
    {
        return retailprice1;
    }

    public void setRetailprice1(double retailprice1)
    {
        this.retailprice1 = retailprice1;
    }

    public Map<String, String> getMeta()
    {
        return meta;
    }

    public void setMeta(Map<String, String> meta)
    {
        this.meta = meta;
    }

    public String getDes()
    {
        return des;
    }

    public void setDes(String des)
    {
        this.des = des;
    }

    public long getClick()
    {
        return click;
    }

    public void setClick(long click)
    {
        this.click = click;
    }

}
